package com.example.boot.factorycase.collector.bairong;

import com.example.boot.factorycase.AbstractPreCheckScoreCollector;
import com.example.boot.factorycase.PreCheckCollectorEnum;
import com.example.boot.factorycase.PreCheckScoreCollectorFactory;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;


@Service
@Slf4j
@RequiredArgsConstructor
public class BaiRongServiceDelegate extends AbstractPreCheckScoreCollector {

    @Override
    public void afterPropertiesSet() throws Exception {
        PreCheckScoreCollectorFactory.addCollector(PreCheckCollectorEnum.BAI_RONG.getCode(), this);
    }

    @Override
    protected void writeScore(String score) {
        preCheckDto.get().setScore(score + "_BR");
    }

    @Override
    protected String readScore() {
        return preCheckDto.get().getScore();
    }
}
